﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace UnInstallTicketM
{
    class Logger
    {
        public static void CreateLogEntry(string Message)
        {
            String LogPath = Path.GetPathRoot(System.Environment.SystemDirectory) + @"\Program Files\SSGS\Logs";
            if (!Directory.Exists(LogPath))
                Directory.CreateDirectory(LogPath);
            string FileName = DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + ".log";
            if (!File.Exists(LogPath + "\\" + FileName))
                File.CreateText(FileName);
            StreamWriter log = File.AppendText(LogPath + "\\" + FileName);
            log.WriteLine(Message);
            log.Flush();
            log.Close();
        }

    }
}
